<% deploying  = @deployment && !%w(complete canceled).index(@deployment.deploymentState)
   compiling = @environment.ciState == 'locked' %>
<% if compiling %>
  <div class="alert">You can not discard or commit while deployment plan generation is in progress.</div>
  <%= button('Discard', nil,' btn btn-danger disabled') %>
  <%= button('Commit & Deploy', nil,' btn btn-success disabled') %>
<% else %>
  <div>
    <%= link_confirm_busy('Discard',
                          :class   => 'btn btn-danger',
                          :url     => discard_assembly_transition_environment_path(@assembly, @environment),
                          :method  => :post,
                          :confirm => 'Discard changes?',
                          :busy    => 'Discarding changes...') %>
    <%= render 'transition/commit_and_deploy_prompt', :button_label => deploying ? 'Commit' : 'Commit & Deploy' %>
  </div>
<% end %>
